package com.addplus.townmall.server.api.constant;

/**
 * 类名: ErrorCode
 *
 * @author zhangjiehang
 * @version V1.0
 * @date 2018/8/29 下午5:29
 * @description 类描述: 异常码枚举类
 */
public enum ErrorCode {
    //系统-公共基础类
    SYS_SUCCESS("000000", "success"),
    SYS_ERROR_SERVICE("000001", "服务器内部错误"),
    SYS_ERROR_TYPE_LENGTH("000002", "入参参数不一致"),
    SYS_ERROR_NOT_TOKEN("000003", "需要token鉴权"),
    SYS_ERROR_TOKEN_EXPIRE("000004", "token过期"),
    SYS_ERROR_TOKEN_ERROR("000005", "非法token"),
    SYS_ERROR_NULLDATE("000006", "无数据"),
    SYS_ERROR_DATABASEFAIL("000007", "数据库操作失败"),
    SYS_ERROR_PARAM("000008", "入参参数缺失"),
    SYS_ERROR_NOT_AVAILABLE("000009", "无可更新的内容"),
    SYS_ERROR_PATH("000010", "接口路径不存在"),
    SYS_ERROR_NO_MODIFI_ALLOW("000011", "当前内容不允许修改"),
    SYS_ERROR_DATA_EXIT("000012", "数据已存在"),
    SYS_ERROR_REQUEST_TIMEOUT("000013", "网络超时,请重试!"),
    //登录类型错误码
    SYS_LOGIN_LOGGED_IN("010000", "已登录"),
    SYS_LOGIN_UNLOGIN("010001", "未登录"),
    SYS_LOGIN_UNAUTHORITY("010002", "未授权"),
    SYS_LOGIN_CREDENTIAL_ERROE("010003", "密码错误"),
    SYS_LOGIN_ACCOUNT_LOCK("010004", "账号已锁定"),
    SYS_LOGIN_VERIFY_ERROR("010005", "验证码错误或失效"),
    SYS_LOGIN_MEMBER_DISABLE("010006", "账号已冻结"),
    SYS_LOGIN_MEMBER_DELETE("010007", "账号已被删除"),
    //接口类型-商城用户错误码
    REST_MEMBER_DISABLE("020001", "账号被冻结"),
    REST_MEMBER_NO("020002", "商城无此用户"),
    REST_MEMBER_PASSWORD_ERROE("020003", "商城登录密码错误"),
    REST_MEMBER_VERIFICATIONCODE_ERROE("020004", "商城登录验证码错误"),
    REST_MEMBER_VERIFICATIONCODE_INVALID("020005", "商城登录验证码失效"),
    REST_MEMBER_PHONE_ERROR_TELFORMAT("020006", "手机格式不合法"),
    REST_MEMBER_PHONE_EXIT("020007", "手机号码已存在"),
    REST_MEMBER_PHONE_LATER("020008", "验证码请求频繁，稍后请求"),
    REST_MEMBER_ACCOUNT_EXIST("020009", "用户名已被注册"),
    REST_MEMBER_INVITECODE_INVALID("020010", "邀请码无效"),
    REST_MEMBER_PHONE_NOTEXIT("020011", "手机号码不存在"),
    REST_MEMBER_OLDPASSWORD_ERROE("020012", "旧密码验证失败"),
    REST_MEMBER_PARAM_NEED_MORE("020013", "部分所需参数缺失"),
    REST_MEMBER_ADDRESS_NONE("020014", "当前选择地址错误"),
    REST_MEMBER_ADDRESS_MAX_LIMIT("020015", "收货地址达到最大限制"),
    REST_MEMBER_WECHATE_PHONE("020016", "获取微信手机号失败"),
    REST_MEMBER_MESSAGE_ERROR("020017", "当前用户信息获取失败"),
    REST_MEMBER_MESSAGE_ACCOUNT("020018", "已有账号名称"),
    REST_MEMBER_MESSAGE_UNREGISTER("020019", "该手机号码未注册"),
    //接口类型-商品详情错误码
    REST_SHOP_PRODUCT_JSON_ERROR("030001", "规格参数错误"),
    REST_SHOP_PRODUCT_COMMENT_UNFINISH("030002", "当前订单未完成"),
    REST_SHOP_PRODUCT_COMMENT_UNCOMMENT("030003", "当前订单已评价"),
    REST_SHOP_PRODUCT_COMMENT_UNEXIT("030004", "当前订单不存在"),
    REST_SHOP_PRODUCT_ORDER_INVOICE("030005", "发票已开具"),
    REST_SHOP_PRODUCT_NO_EXIT("030006", "当前商品不可添加到购物车"),
    REST_SHOP_PRODUCT_NOEXIT("030007", "当前商品不存在"),
    REST_SHOP_PRODUCT_COMMENT_FINISH("030008", "当前订单已完成"),
    REST_SHOP_PRODUCT_REDUND_ORDER("030009", "查询不到对应订单"),
    REST_SHOP_PRODUCT_REDUND_ORDER_ITEMS("030010", "查询不到对应订单详情"),
    REST_SHOP_PRODUCT_REDUND_REDUN_NUM("030011", "退货数量大于最大可退数量"),
    REST_SHOP_PRODUCT_REDUND_ORDER_FINISH("030012", "当前提交商品已有在退款或已退款"),
    REST_SHOP_PRODUCT_REDUND_CLOSE("030013", "当前申请已完成或已关闭"),
    REST_SHOP_PRODUCT_UNCLOSE("030014", "当前订单不允许删除"),
    //接口类型-用户收藏错误码
    REST_COLLECT_EXIT("040001", "已收藏"),
    REST_COLLECT_NO_EXIT("040002", "未收藏"),
    //接口类型-分销错误码
    REST_DISTRIBUTION_INVITE_MEMBER_NOEXIT("050001", "邀请用户不存在"),
    REST_DISTRIBUTION_QRCODE("050002", "获取分销二维码失败"),
    REST_DISTRIBUTION_RECEIVE("050003", "已获取特殊奖励"),
    REST_DISTRIBUTION_WITHDRAW_QUATE("050004", "未达到获取特殊奖励"),
    //接口类型-申请错误码
    //接口类型-全局搜索错误码
    REST_GLOBALSEARCH_PARAMERROR("060001", "搜索输入参数有误"),
    //接口类型-申请审核错误码
    REST_ADUIT_APPLYING("070001", "该用户正在申请入驻"),
    REST_ADUIT_APPLIED("070002", "该用户已入驻小镇"),
    REST_ADUIT_APPLIERRROR("070003", "申请失败,请联系客服处理"),
    REST_ADUIT_PARENERED("070004", "已申请过合伙人,请勿重复申请"),
    REST_ADUIT_PARENEERRROR("070005", "申请失败,请联系客服处理"),
    //接口类型-缓存错误码
    REST_CACHE_NOKEY("080001", "不存在的缓存位置"),
    //接口类型-订单错误码
    REST_ORDER_CONFIRM_NOSHOP("09001", "确认订单商品查询失败"),
    REST_ORDER_CONFIRM_NOSTOCK("09002", "确认订单商品已售罄"),
    REST_ORDER_CONFIRM_NOSTOCK_ENOUGH("09003", "订单库存不足"),
    REST_ORDER_CONFIRM_FAILURE("09004", "生成订单失败"),
    REST_ORDER_QUERY_FAILURE("09005", "查询订单失败"),
    REST_ORDER_QUERY_CANCEL("09006", "当前订单不能取消"),
    REST_ORDER_QUERY_UPDATEADDRESS("09007", "当前订单状态不能修改收货地址"),
    REST_ORDER_QUERY_PAY_ERRORUNM("09008", "当前支付失败，请重试！"),
    REST_ORDER_QUERY_PAY_TIMEOUT("09009", "当前订单已超时"),
    REST_ORDER_QUERY_PAY_REPEAT("09010", "当前订单重复生成"),
    REST_ORDER_QUERY_PAY_PAY("09011", "当前订单已付款"),
    REST_ORDER_QUERY_CLOSE("09012", "当前订单已超时"),
    REST_ORDER_QUERY_CANCEL_ALL("09014", "当前订单已取消"),
    REST_ORDER_QUERY_LIMIT("09013", "下单数量超过活动限制"),
    REST_ORDER_REFUND_STORE_CONFIRM_GOODS("09014", "申请售后单暂不能提交物流信息"),
    REST_ORDER_REFUND_CONFIRMED("09015", "当前商品已提交申请售后"),
    //接口类型-会员打折相关逻辑错误码
    REST_DISCOUNT_INTEGRAL_LACK("100001", "积分不足"),
    //接口类型-会员优惠券错误码
    REST_COUPON_RECEIVE_EXIT("11001", "优惠券已经领取了"),
    REST_COUPON_RECEIVE_EXPIRE("11002", "优惠券已过期"),
    REST_COUPON_RECEIVE_UNSTART("11003", "优惠券未开始使用"),
    REST_COUPON_RECEIVE_UNUSE("11004", "优惠券不适用该商品"),
    REST_COUPON_RECEIVE_USE("11005", "优惠券已使用"),
    REST_COUPON_RECEIVE_DOWNLINE("11006", "优惠券已下架"),
    REST_COUPON_RECEIVE_NOEXIT("11007", "优惠券不存在"),
    REST_COUPON_RECEIVE_FINISH("11008", "优惠券已经领取完毕"),
    //接口类型-商品店铺错误码
    REST_STORE_UNEXIT("12001", "商城无此店铺"),
    REST_STORE_EXIST("12002", "自营店铺已存在"),
    //接口类型-商城会员卡
    REST_MEMBER_CARD_NOEXIT("13001", "当前会员卡不存在"),
    REST_MEMBER_CARD_OPEN_LIMIT("13002", "暂不能开通该会员卡"),
    //接口类型-拼团
    REST_FIGHT_SHOP_ISONLY("14001", "拼团商品不允许单独开团"),
    REST_FIGHT_SHOP_ISMORE("14002", "拼团商品不允许允许多件购买"),
    REST_FIGHT_SHOP_BUYLIMIT("14003", "拼团商品限购数量"),
    REST_FIGHT_SHOP_ONEBUYLIMIT("14004", "拼团商品超过单次限购数量"),
    REST_FIGHT_SHOP_ONLINESTATUS("14005", "拼团商品已下架"),
    REST_FIGHT_SHOP_PARTFIGHTFAILE("14006", "参团失败，拼团人数已足够"),
    // 接口类型-礼品卡
    REST_GIFT_CARD_BATCH("15001", "礼品卡生成失败"),
    REST_GIFT_CARD_SELECT_NULL("15002", "礼品卡查询失败"),
    REST_GIFT_CARD_SELECT_EXPIRE("15003", "礼品卡已失效"),
    REST_GIFT_CARD_SELECT_USEFUL("15004", "礼品卡余额为0"),
    REST_GIFT_CARD_SELECT_BINDING("15005", "礼品卡已被绑定"),
    REST_GIFT_CARD_SELECT_ERROR("15006", "礼品卡卡号或密码错误"),
    REST_GIFT_CARD_SELECT_UNSTART("15007", "礼品卡暂未能使用"),
    // 接口类型-提现错误
    REST_WITHDRAW_WAIT_AUDIT("16001", "提现申请还有未处理"),
    REST_WITHDRAW_AMOUNT_HUNDRED("16002", "提现余额不足整百元"),
    REST_WITHDRAW_AMOUNT_INSUFFICIENT("16003", "提现余额不足");

    private String code;

    private String error;

    ErrorCode(String code, String error) {
        this.code = code;
        this.error = error;
    }


    public String getCode() {
        return code;
    }

    public void setCode(String code) {
        this.code = code;
    }

    public String getError() {
        return error;
    }

    public void setError(String error) {
        this.error = error;
    }
}
